home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
wdj0697.zip
/
TECHTIPS.ZIP
/
TIPSVIEW.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-06-23
|
2KB
|
111 lines
// TipsView.cpp : implementation of the CTipsView class
//
#include "stdafx.h"
#include "Tips.h"
#include "TipsDoc.h"
#include "TipsView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTipsView
IMPLEMENT_DYNCREATE(CTipsView, CView)
BEGIN_MESSAGE_MAP(CTipsView, CView)
//{{AFX_MSG_MAP(CTipsView)
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTipsView construction/destruction
CTipsView::CTipsView()
{
// TODO: add construction code here
}
CTipsView::~CTipsView()
{
}
BOOL CTipsView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CTipsView drawing
void CTipsView::OnDraw(CDC* pDC)
{
CTipsDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CTipsView diagnostics
#ifdef _DEBUG
void CTipsView::AssertValid() const
{
CView::AssertValid();
}
void CTipsView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CTipsDoc* CTipsView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTipsDoc)));
return (CTipsDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CTipsView message handlers
int CTipsView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
EnableToolTips () ;
return 0;
}
int
CTipsView::OnToolHitTest(CPoint point, TOOLINFO* pTI) const
{
const int nID = MAKELONG (point.x, point.y) + 1 ;
if (pTI != NULL)
{
pTI->hwnd = m_hWnd;
pTI->uId = nID ;
pTI->rect = CRect (point, CSize (1, 1)) ;
CString str ;
str.Format ("%ld, %ld", point.x, point.y) ;
// warning! MFC deletes this string - one must pass a copy
pTI->lpszText = _strdup (str) ;
}
return nID ;
}